<template>
  <BasicModal
    v-bind="$attrs"
    @register="register"
    title="预警发送"
    :footer="null"
    :width="1200"
    :destroyOnClose="true"
    wrapClassName="stationPopup"
    @height-change="handleHeightChange"
  >
    <WarningInfo :data="state.tableRowData" @close="onClose"/>
  </BasicModal>
</template>

<script lang="ts" setup>
  import { ref, reactive, provide } from 'vue';
  import { BasicModal, useModalInner } from '@gui-pkg/antdcomponents';
  import WarningInfo from './warningInfo.vue';

  const modalHeightValue = ref(880);
  const state = reactive({
    tableRowData: null,
  });

  const [register, { setModalProps ,closeModal}] = useModalInner(async (data) => {
    setModalProps({ confirmLoading: false });
    state.tableRowData = data.record;
  });
  const onClose = (height: string) => {
    closeModal();
  };
  // 弹窗高度变化，主要是监听是否点击了全屏
  const handleHeightChange = (height: string) => {
    modalHeightValue.value = height;
  };
  provide('ModalHeightChange', modalHeightValue);
</script>

<style lang="less" rel="stylesheet/less" scoped>
</style>
